<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>

  <body>
    <style>
        .box {
          width: 200px;
          height: 200px;
          border: 2px solid rgba(0, 0, 0, 0.5);
          margin: 10px;
          float: left;
        }
        .bg {
          background-image: linear-gradient(red, red), linear-gradient(red, red),
            linear-gradient(red, red), linear-gradient(red, red);
          background-size: 20px 20px;
          background-repeat: no-repeat;
          background-position: 0 0, 184px 0, 184px 184px, 0 184px;
          background-origin: border-box;
        }
        .mask {
          mask: linear-gradient(red, red), linear-gradient(red, red), linear-gradient(
              red,
              red
            ), linear-gradient(red, red);
          mask-size: 20px 20px;
          mask-repeat: no-repeat;
          mask-position: 0 0, 184px 0, 184px 184px, 0 184px;
          /* mask-origin: border-box; 
              默认值就是 border-box  */
        }
      
        .mask2 {
          /* background-image: conic-gradient(
              at 20px 20px,
              transparent 270deg,
              red 270deg
              ); 
              background-origin: border-box; */
          background-size: calc(100% - 20px) calc(100% - 20px);
          mask: conic-gradient(at 20px 20px, transparent 270deg, red 270deg);
          mask-size: calc(100% - 20px) calc(100% - 20px);
        }
      </style>
      <div class="box bg"></div>
      <div class="box mask"></div>
      <div class="box mask2"></div>
  </body>
</html>
